<?php
	require_once('PageBase.php');
	require_once('DataAccess/DataModel/MailData.php');

class MailingDetail extends PageBase
{
	public function __construct()
	{
		parent::__construct();

	}	


	public function pageLoad()
	{
		$mail =& new MailData();
		$mail->setMailId($this->params["id"]);
		$mail->select();
		if($mail->getMailId() == null)
		{
			return;
		}
		if($this->params["permission"] != CommonConfig::getAdminAddress()
			&& ($mail->getMailType() != MLCOM_MAIL_TYPE_MLIST || 
			$mail->getMailStatus() != MLCOM_MAIL_STATUS_SENT))
		{
			return;
		}
		$this->smarty->assign("MailId", $mail->getMailId());
		$this->smarty->assign("Subject", $mail->getSubject());
		$this->smarty->assign("Body", $mail->getBody());
		$this->smarty->assign("Date", $mail->getAddDate());
		$this->smarty->assign("Sender", $mail->getUserName());
		$this->smarty->display("MailDetail.htpl");
	}
}	
	

?>